export enum FormMode {
  Add = 0,
  Edit,
}

export const FormTitleByMode: string[] = ['新增', '编辑']

export enum Gender {
  Undefined = 0,
  Male,
  Female,
}

export const GenderToString: string[] = ['未定义', '男', '女']
export const GenderRatioOptions: { label: string; value: number }[] = GenderToString.map(
  (item, index) => ({
    label: item,
    value: index,
  }),
)

export const GenderTagMapper: { [key: number]: { text: string; type: string } } = {
  [Gender.Undefined]: { text: '未定义', type: 'info' },
  [Gender.Male]: { text: '男', type: 'primary' },
  [Gender.Female]: { text: '女', type: 'success' },
}

export enum PermissionType {
  Directory = 0,
  Menu,
  Operation,
}

export const PermissionTypeToString: string[] = ['目录', '菜单', '操作']
export const PermissionTypeRatioOptions: { label: string; value: number }[] =
  PermissionTypeToString.map((item, index) => ({
    label: item,
    value: index,
  }))
